Added more debug information for specific point
Fixed bug: verify entry MAT is not empty
Added lines to measure duration of program
Fixed small problems