code for worksheet 4