fixed fintInt error in trim algorithm