code from robotics class