Full code review

Move all these constants in a separate input file with parameters. One that will run your code should be able to modify these params without having to modify and recompile your code.