improved parser code, added some unit tests