Changed IMU code to use different delay function