began filling out algorithm sketch