various algos in python