Patched for running with i-PI. First rudimentary implementation