updated code samples to reflect library changes