A few python functions