core implementation (wip)