reformatted insertlog script