lin_alg: better semantics, apply these to main
lin_alg: semantic changes, applied to main