clean the loss and poe loss curve arrays in a beter way