added a bit more randomness to rand()