complete mine game as function