Main code before fix hashGrid() func
Check out comment