the code checked on 4 by 4 matrix