Correct mine counting bug, remove unnecesary code