change implementation to python only