working module to save snippet to file