better behaved python script