code snippet from various projects