Working sequence generator - needs to write to file