Added move checking logic