add secondary rotation algorithm... not sure if it is good