add functions

add a few functions which was coded some time ago