generating the script for the marginal probability distribution done. Small bugs still exist