Made fixes to work for isEquivalent

Fixed typos in the function and added a missed break statement. Changed isEquivalent to const as well