Cleaned up code according to milestone Code Cleaing #1. Probably needs further cleaning.