code from mobile computing class