Updated with code changes from class.