now writes output to answers file