The C# code for 2D simulations