Added algorithm explaination