nested function implemented. Wrote a few test cases at bottom (just have to uncomment and run
Merge branch 'master' of https://github.com/sohamghosh121/rhs

merge