Add explanation and code as a gist.