final prototype of doc compiler