my implementations of various algos