working randomizer and distances
updated TODO