using random(3) instead of rand(3) and seeding with /dev/random instead of time