why variables[0]?  you should probably raise `if len(f.variables)` test.