Working on distance checking