Little bit simplified and docs added.