Cleaned up code to match style guide