Found incomplete coding in rotate function