Added pseudo code for functionality