updated documentation and added callbacks