Creating a system of linear equations