one of the rand() calls is still used - put them back