Sample code I've written in the past.