Merged and fixed the rotation problem