Add writer, complete test for program full functionality