added the optional callback function
documentation updates