Added compatibility for multiple insulator layers and boundary resistances