use POSIX random functions