try to implement in python.