changes input from char to int to prevent segfault