added srand() based random number generation for testing