new functions and added function documentations