Matrix not lining up correctly