added dist

added dist from paper. cleaned up a bit