add tests and add a bit of color coding and make errors nicer