Merge pull request #2 from grimborg/master

adding better validation error
Merge pull request #3 from grimborg/master

cleaned up tests, improved exception
added docstrings
merged
Merge pull request #4 from amakhnach/master

added docstrings
merge