fixed some errors, removed trailing whitespace