corrected the .equals() conditions