first version with equality tests