add most of functionality, zero bugtest.