clear code and fix "==" method error