Calculating Sequence and Distance