added rotation and fixed a bug