modified datapath and controller