Fix code ad produce figures