fixed parser and calculator for string input