MadDirectLayer

Updated MadDirectLayer with more encapsulation