code to detect mines by hq