full multilayer calculation