Code snippets as found at theunemployablekoder.wordpress.com