adding more inputs and working on dfs solution