initial Python version
refactor to pandas