Refactor time :
Changing the style for be more appropriate with PEP8 (http://legacy.python.org/dev/peps/pep-0008/)
Changed has_key() for in (deprecated in python 3)