small refactor, verify if its tail recursive
add some more problem sets