instead of getchar, use scanf, trying to fix double > printing error when given , command