working on distance based