added psudocode for new functionality
fixed indent error