#4 make loss graph logic