rotation algorithm is not working properly, linear, pastel