Changed return 1 to return toInt of input so that it will work for all single numbers.