Complete Code for experiments