added pseudocode with what I need to figure out