Edited Python code