move building carousel to function file