The American officer most determined to close down Barataria was a 25-year-old naval lieutenant , Daniel Tod Patterson , who had spent unpleasant time as a captive in Tripoli -LRB- today 's Libya -RRB- .