some helper functions for code examples