added parser class to deal with the input string