changed the space trim function to also change tabs to spaces