adding trim function