changed scan and rotate