pseudo code for nadia