Added a second sample, plus some code cleanup