added a check to enforce a lower bound of 1 for j1,j2