writing to currentlevel

ctn and oe get written to levelX dictionaries. also some cleanup done.

Still needed: merging of files, new var names for less confusion