Added border recognizion on the fragment generation