Distance formula a little wonky