Changed algo for checking on ground