Huge refactor to handle 16x16 matrix and 4 panels