Added simple rotation algorithm