better frame merging