remove unused variable 'subString'. Fixed trailing whitespace