Modified code in accordance with Issue #14.