First version, need tests.