minor fixes
rewrote parser