lowering of nicks for db matches, corrected logic for success vs error states, cleaned up code a bit