Added exception class for wrong data passed to the tx function.
added documentation.