some more adjustment for cleaner algo