added pseudocode part3