matrix laying out done