Add code from gist and write README