Code Refactored

Cleaned code up and renamed things.