Changed to distance based attachment