Time profiling added. Int to short (not good...) in 3D matrix, it reduces RAM size a lot (half).