Made example code consistent with drawn block diagram