TATAS algorithm
overflow throw removed