updating examples to run off S4 objects