initial upload of core, transferred from structuredfun-pc