solving systems of linear relations