Changed Assertion to allow custom functions. Added docs.