building BLAST algorithm