added write functionality, saved as gum2.py

also, rid of extraneous functions