Rewrote callbacks and added to the documentation.