use stoi instead of atoi