compiler code almost done (still untested)