code for the haptic experiment