completed code samples