code examples and some solutions suitable for reuse