fixed the rotate() func for angles which are multiple of 90

fixed the rotate() func for angles which are multiple of 90