Trying to get parser to work for all cases but failing woefully