Here I resolved the problem but this version still needs polishing