Gist replaced with actual code