adapted cres_in_range() to use new table main_corem_cres