Conditional logic added, better error handling

+ readme changes