modified method compiler to compile closures