some python scripts and functions