BLAST algorithm implemented up to extension phase