unit tests + factored out random() to separate files