auxiliary python functions