debugging and bugfixing