Add rotate function: previous cases passing