debugging code example from lecture