Sample Code for Patterns and Common Problems