cleaned a bit python mode