rotation implemented, fixed some insert bugs