add matrix comparison