implemented frame merge