better speed algorithm