how to assign mines and how to count them