Seems to behave correctly. No implementation of the improved version