finished implementing left expansion