implemented border normalization