Added random-range function, polished up a bit