Implemented exceptions
Merge pull request #1 from cym13/master

Implemented exceptions