random library and test program