Added MRCA function and made code corrections.