Matrix algebra in Erlang