parser was not handling last input correctly; had to change the data
structure but seems to work as expected now.