completed all pattern code examples