added 4x4 and 5x5 support