First Python implementation