Implemented function for generating linear system