First version of closure conversion working