first working version, based on projectdb --KW