update: added convenience random number generator function