improved code samples