added pseudocode now that I have been working on this for an hour and understand the problem a little better. also added jade. need to convert the html to jade.