cleaned up the overhelming snippets of code commented, minor bug fixes