error messages and fixing sorting
Merge pull request #17 from apatel/master

error messages and fixing sorting