samurai code is called "the way of the warrior"the way of the warrior means to be fearless in the way of death and to be honest and fair.This custom helps struction the society by being undoubted this would help make people trust the samurai with out trust in the samurai people would try to get rid of the samurai and start to doubt the goverment.
Buddhism and shinto were the two main religions in japan in shinto people worship their ancestors and the nature spirits and beliefs in the sacred power Buddhism is a religion where people have belife and spiratule practices based on the teachings of amida buddah. These religions helped structure society by helping people find peace they also learned to be helpful and respectuful with out these religious practices they would be less peacfull and open minded.
Cultural diffusion is when two cultures come together and get new ideas from each other. This would improve the economy and it would get rid of fights.