added removal of trailing whitespace