filling in pseudo-code