declare rel2 outside loop