Design Patterns example code from website