Sulfur heterocycle forming reactions