removed an apparently complicated way to trim whitespace off, also threw php notices