matrix algebra implementation

logical_lt problem. going to add for loop on the transition