algorithm and related things.