fixed some bugs, work on parsing and unit tests