Fixed some code for ya

Fixed some organizational issues, fixed frame rate issues.