Partially done with this problem
Solved it.