new version of core, added some tests