new algorithm, much faster :-)