added/improved python integration