(1) Changed the rotate function to be more general. Implemented shiftrows.