also works in python 3.2 and 3.4