new functions and fixes