Crunching some code here in Python