Loss function + extracting graph + SF points