First pass, with tests