Added trim subroutine