week 2 dfs optimizations