write "bad" file
globals
assumes medley
side-effect
add scoping
remove side-effect
remove cmg dependency