Added check for deep equality and used it with a new method 'contains'