Checking overlapping elements