Fixed some minor silly bugs
Added rstrip of each line before comparison
Changed style of appending to file
added stripping of all whitespace and rstrip before if statements