removing matrix algorithms