BETTER2: reorganized and commented for clarity