finally wired together all the flattening components, now filling in different expressions