changed == to .equals() when appropriate