Added include for rand()