an initial version (still lots to do!)