Several changes bringing it mostly in line with example
Hard merged work copy