adding new functions and tests