formulating code using Todd's framework.