52 templated. Warnings fixed
matrix sort complete