Reduce to 3D when plotting
Refactoring, separate script for learning parameters