update pivot function

removed excess code from pivot, no need to have '.' before and after word, start and end were the same regardless of if/else result.