solved the josephus problem