Got rid of usleep()
Changed c array to vector<>