more parsing, and bug fixes