misunderstand the problem leading to complicated and slow solution, TODO