Cleaned up code and removed extra whitespace