rewrote unit test of mkrand