improvements to parsing but still WIP