Change GetLoss() to private, cleaned code.