Apologies for my careless reading, Costas. The problem is that you need to replace the '=' in 'elif x = 2:' with '=='. The-dyslexic-leading-the-blind'ly yrs. :~) Alex -- Alex Coventry (finger alex_coventry at mit.edu)