Added trim function