implements the form in the cookbook