Working solution. Yet to work on json obj