filled function added (completed exercises for 3rd chapter)