working with tiles and mines
changed back to buggy version, it is a little more readable