added code to calculate the theta and xi variables in wtf_fns, including getting the likelihood of the emissions