re-organized code

still made the 24 hour commit deadline. woot?