after leaving the mine of his three friends , he had made a wide sweep in a circle around the town , riding a few miles north , then traveling west until he was in the rugged mountains on the opposite side of the valley .