More code to spec, starting to add tests