Added more test cases. Also tweaked codes to remove spaces when comparing character variables.