added new functions, changes in older functions, added documentation to some