Updated from previous chapter (PR #16 and #17)