adding manual function to trim whitespace as ,$