Here's some code.