refactors random range from #count to #rand