Alvik: Detecting Falling and Crashes (IMU) Corrected Code

The code for detecting falling and crashes (IMU) for Arduino Alvik is not working at all, which is given on official website on this link.
I modified the code by directly calling the relevant functions for orientation, acceleration and gyros and now its working quite correctly.
What was the problem, please guide. However, still I don't understand how to use it for controlling motors using the IMU data.

from arduino_alvik import ArduinoAlvik
import time

# Initialization
alvik = ArduinoAlvik()
alvik.begin()

# Give some time for initialization

while True:
    r = alvik.get_orientation()
    p = alvik.get_orientation()
    y = alvik.get_orientation()
 
    ax = alvik.get_accelerations()
    ay = alvik.get_accelerations()
    az = alvik.get_accelerations()
    
    gx = alvik.get_gyros()
    gy = alvik.get_gyros()
    gz = alvik.get_gyros()
    
    print(f'r: {r}')
    print(f'p: {p}')
    print(f'y: {y}')
    print(f'ax: {ax}')
    print(f'ay: {ay}')
    print(f'az: {az}')
    print(f'gx: {gx}')
    print(f'gy: {gy}')
    print(f'gz: {gz}')

    time.sleep(5)