Implementing clone and isEqual methods