Minor progress on loop generation