working properly before matrix changes