Correcting python syntax