everything is working except for dealing with spaces at the end of def