bugfixes, core functionality done