Good Topdown recursion and memoization

Signed-off-by: Vineel Kumar Reddy Kovvuri <vineelkumarreddy@gmail.com>