Free matrices

It solves partially #77 in the sense that, now I can run the app until the end, but from time to time, it gives a segmentation fault :-1: 

Need more debugging.