http://code.google.com/p/make-it-so/ rewrite in python