wip
bugfixes, lib cleanup