serial code working for 4x4 example