created header files and demo
Better error handling, checks for empty result set