change random function to libc - rand