TODO: the josephus problem