Modified to support python 2.4+