small modification to tropicalization function