tested functions up to rotate (including it)