different algorithm for different languages

different algorithm for different languages