Major modifs to Programme - attempt to add home made shared variable engine