Change to use hash of fields
Build the sql
Working