Added test case scenario as well as updating logic for generating nested items
Initial clean up
Clean up and small bug fix