added random function from cstdlib