Refactor new_positions method to be usable in decoding