I would be happy to share the code for anyone who can help me. Its quite a struggle. I have attached the loss graphenter image description here