add code to perform basic closure conversion