Synthesis and utilization of ionic liquids