changed matrix implementation to only query once per video, then use template to block by compartment