removed the custom trim function, javascript has trim built in.