smirnov 343 and 353 algorithms