added some styles, added pseudocode