filled in pseudo code