adding makeSQL function