Corrected example code and added some explanation of usage.