updated likelihood routine, though still working on it