Changed writemem to append.
Updated readme
condensed code