added new functions and documentation