encoding printing to screen(working); encode now takes name of file to write to;