use iterative method instead of recursive memoized
modify tests
remove empty method