corrected Contains methods in rect