updated for the strict usage of Python2