Made it check for closest x