human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: Rank, Nation, Gold, Silver, Bronze, Total
###Question: What is the highest Total with a Rank that is smaller than 4 and a Nation of tunisia (tun) with a Gold that is smaller than 2?
gpt
SELECT MAX Total FROM table WHERE Rank < 4 AND Nation = tunisia (tun) AND Gold < 2