Added some enhancements on the way to finish #6.