Implemented 2D masking method for step 5

Also, I'm not sure if the boundary conditions are correctly explained
before the code begins here