Cleaned up code, starting to use better names for things