Classes is now located in separate files. Also made some changes to rotation algoritm.