First pass, missing some tests.