Sample code part two of three. Sorry this is long. If you have questions about the code, let me know.