finished 1st version of singular systems