some pseudo code for hw10