Cleaned up code formatting and comments