found memory leak issue... srand. put in comments