added code from Part 4 of the Home Network of Things
added more code from Part 4 of the Home Network of Things