random number gen now actually works + timing function