Added code for gold mine problem