changed if clauses for checking if rescomp