mine() and beacon() functions