TODO: a none-recursive way to solve this again