WIP working! todo: rebase & cleanup