Made likelihood calculation more rigorous
Miscellaneous work on Test cases