Creating a source matrix