Pseudo code for algorithm added