draft of parallel version in python