Edge checking for movement