updated for new python syntax