added Sage interface and parallel version