matrix logic implemented on back end