modified rand library for adding namespace functions