Added algorithm and many other things