removed unused writer function