improved python scripts