josephus problem, first try updated