add pseudocode for most of exercises

adapt solutions to use functions as they are view earlier
externalize code to be dowloadable for student