Merge https://gist.github.com/4256092
Interesting gist about iterating over tuples.