merged gasagna/master branch with the modified lib.pyx