first commit. tests are green. code not too bad.