Adjustments made based on comparison to github example.