Replace cin >> with getline() and fix input

cin >> input would stop listening at spaces