rebased; tests wip