cplusplus sort-of working

refs need fixing up