cached approach to the random numbers solution
slight tweak
tweaks