Final working code for maven miner