Imported code from RoboController repo