use space too much, change to more complex algorithm