completed code for Roberts