linear-algebra: slower and faster versions