fixed bugs. experiment now ready to check with Peter