add some input checking and exception classes
delet unrelated file
Merge pull request #32 from QingxianLai/master

add input checking and exception classes