work on second case of compile_top_thm