fixed a bug in the mine generating function