bit of work on compile_prog_thm