Not quite done - need to handle expression generation inside while loops