use pattern matching in rotateLists