Added support for a quiet flag to suppress output
Not needed
Replaced for in with while loops
Skips initial lines prefixed by # comment
Pulled out boundary conditions initialisation into new functions