This code does not match the way that the framework is intended to function.
I would recommend heading over to
www.frcmastery.com and watching at least the first video under "2011 FRC Steps to Robot Success" on the right side of the page. They really do a good job.