first steps in bulding the expand function