modulized code, & cleaned it up alot. Still needs posting to server