bug fix; optimizations; proper python embedding