matrix size larger than 4 is working now