Rewrote surrounding mine function and other stuff
resolved conflict