major core change, working but not yet finished version