Moved section to correct place
Added loss functions