Added trim subroutine to eleminate excess white space