working MAR function with new layers