Removed trailing spaces

Removed trailing spaces and improved comments