Working on det for 3x3 and 4x4 matrices