Works on both Python2 and 3