Adding trimEdge function