Implement Davies's suggestions in Python