Added color/bw option to writer.
Added proper closing to reader and writer.