add likelihood and if else loops