simplify mad and add details to doc
Merge pull request #98 from gummif/mad

Simplify mad and add details to doc