http://gist.github.com/raw/577372/3bbb18c1e1c30902239f44e533fb910ebf3c34cd/gistfile1.rb