Implementations in python