added more descriptive assertion error message, and updated comments