new functions and bugfixes