Cleaned up code and whitespace