strip trailing whitespace
remove whitespace and comments