finishing integrated mag function  + plot