Added reset feature.
Expanded function comments.