realigned with wmcbrine's pyTivo code