finish the most fundamental function, but still has distance to be used