Update pell.py

Working implementation