Avoiding using Set in favor of set-like lists (more general).
Used another matrix library that seems to be more fitting and richer.
Minor changes.