porting other code to IMU, improvements