diff --git a/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatistics.java b/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatistics.java
index 3b09618..f726cbe 100644
--- a/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatistics.java
+++ b/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatistics.java
@@ -10,9 +10,10 @@
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ * See the License for  the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.packetstats;
 import com.codahale.metrics.Counter;
 import org.apache.felix.scr.annotations.Activate;
@@ -43,7 +44,7 @@
  * Application for Packet Statistics.
  */
 @Component(immediate = true)
-public class PacketStatistics {
+public class  PacketStatistics {
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     protected PacketService packetService;
@@ -125,30 +126,30 @@
         this.unknownFeature =
                 packetStatisticsComponent.registerFeature("unknownFeature");
         this.arpCounter =
-                metricService.createCounter(packetStatisticsComponent, arpFeature, "ARP Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, arpFeature, "arpPC");
         this.dhcpCounter =
-                metricService.createCounter(packetStatisticsComponent, dhcpFeature, "DHCP Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, dhcpFeature, "dhcpPC");
         this.lldpCounter =
-                metricService.createCounter(packetStatisticsComponent, lldpFeature, "LLDP Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, lldpFeature, "lldpPC");
         this.vlanCounter =
-                metricService.createCounter(packetStatisticsComponent, vlanFeature, "VLAN Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, vlanFeature, "vlanPC");
         this.icmpCounter =
-                metricService.createCounter(packetStatisticsComponent, icmpFeature, "ICMP Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, icmpFeature, "icmpPC");
         this.igmpCounter =
-                metricService.createCounter(packetStatisticsComponent, igmpFeature, "IGMP Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, igmpFeature, "igmpPC");
         this.pimCounter =
-                metricService.createCounter(packetStatisticsComponent, pimFeature, "PIM Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, pimFeature, "pimPC");
         this.bsnCounter =
-                metricService.createCounter(packetStatisticsComponent, bsnFeature, "BSN Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, bsnFeature, "bsnPC");
         this.mplsCounter =
-                metricService.createCounter(packetStatisticsComponent, bsnFeature, "MPLS Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, mplsFeature, "mplsPC");
         this.unknownCounter =
-                metricService.createCounter(packetStatisticsComponent, bsnFeature, "Unknown Packet Counter");
+                metricService.createCounter(packetStatisticsComponent, unknownFeature, "unknownPC");
 
 
         appId = coreService.registerApplication("org.onosproject.packet-stats");
 
-        packetService.addProcessor(processor, PacketProcessor.director(2));
+        packetService.addProcessor(processor, PacketProcessor.director(0));
         log.info("Started", appId.id());
 
 
diff --git a/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatsUiComponent.java b/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatsUiComponent.java
new file mode 100644
index 0000000..c55c40b
--- /dev/null
+++ b/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatsUiComponent.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.packetstats;
+
+
+import com.google.common.collect.ImmutableList;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.onosproject.ui.UiExtension;
+import org.onosproject.ui.UiExtensionService;
+import org.onosproject.ui.UiMessageHandlerFactory;
+import org.onosproject.ui.UiView;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+/**
+ *  ONOS UI Custom-View application component for the Packet Statistics Application.
+ */
+@Component(immediate = true)
+public class PacketStatsUiComponent {
+    private static final String VIEW_ID = "sampleCustom";
+    private static final String VIEW_TEXT = "Packet Statistics Application";
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected UiExtensionService uiExtensionService;
+
+    // List of application views
+    private final List<UiView> uiViews = ImmutableList.of(
+            new UiView(UiView.Category.OTHER, VIEW_ID, VIEW_TEXT)
+    );
+
+
+    // Factory for UI message handlers
+    private final UiMessageHandlerFactory messageHandlerFactory =
+            () -> ImmutableList.of(new PacketStatsUiMessageHandler());
+
+
+    // Application UI extension
+    protected UiExtension extension =
+            new UiExtension.Builder(getClass().getClassLoader(), uiViews)
+                    .resourcePath(VIEW_ID)
+                    .messageHandlerFactory(messageHandlerFactory)
+                    .build();
+
+    @Activate
+    protected void activate() {
+        uiExtensionService.register(extension);
+        log.info("Started");
+    }
+
+    @Deactivate
+    protected void deactivate() {
+        uiExtensionService.unregister(extension);
+        log.info("Stopped");
+    }
+
+}
diff --git a/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatsUiMessageHandler.java b/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatsUiMessageHandler.java
new file mode 100644
index 0000000..418d703
--- /dev/null
+++ b/apps/packet-stats/src/main/java/org/onosproject/packetstats/PacketStatsUiMessageHandler.java
@@ -0,0 +1,274 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.packetstats;
+import com.codahale.metrics.Counter;
+import com.codahale.metrics.MetricFilter;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.collect.ImmutableSet;
+import org.onosproject.net.ConnectPoint;
+import org.onlab.metrics.MetricsService;
+import org.onosproject.ui.RequestHandler;
+import org.onosproject.ui.UiMessageHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * ONOS UI Custom-View message handler.
+ * <p>
+ * This class contains the request handlers that handle the response
+ * to each event. In this particular implementation the second message
+ * handler creates the patch and the first message handler loads the data.
+ */
+
+public class PacketStatsUiMessageHandler extends UiMessageHandler {
+
+    private static final String ARP_REQ = "arpRequest";
+    private static final String ARP_RESP = "arpResponse";
+    private static final String DHCP_REQ = "dhcpRequest";
+    private static final String DHCP_RESP = "dhcpResponse";
+    private static final String ICMP_REQ = "icmpRequest";
+    private static final String ICMP_RESP = "icmpResponse";
+    private static final String LLDP_REQ = "lldpRequest";
+    private static final String LLDP_RESP = "lldpResponse";
+    private static final String VLAN_REQ = "vlanRequest";
+    private static final String VLAN_RESP = "vlanResponse";
+    private static final String IGMP_REQ = "igmpRequest";
+    private static final String IGMP_RESP = "igmpResponse";
+    private static final String PIM_REQ = "pimRequest";
+    private static final String PIM_RESP = "pimResponse";
+    private static final String BSN_REQ = "bsnRequest";
+    private static final String BSN_RESP = "bsnResponse";
+    private static final String UNKNOWN_REQ = "unknownRequest";
+    private static final String UNKNOWN_RESP = "unknownResponse";
+    private static final String MPLS_REQ = "mplsRequest";
+    private static final String MPLS_RESP = "mplsResponse";
+
+
+
+
+    private static final String METRIC_NAME = null;
+    private static String total = "";
+
+    private List<ConnectPoint> previous = new ArrayList<>();
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    MetricFilter filter = METRIC_NAME != null ? (name, metric) -> name.equals(METRIC_NAME) : MetricFilter.ALL;
+
+    @Override
+    protected Collection<RequestHandler> createRequestHandlers() {
+        return ImmutableSet.of(
+                new ArpRequestHandler(),
+                new DhcpRequestHandler(),
+                new IcmpRequestHandler(),
+                new LldpRequestHandler(),
+                new VlanRequestHandler(),
+                new IgmpRequestHandler(),
+                new PimRequestHandler(),
+                new BsnRequestHandler(),
+                new UnknownRequestHandler(),
+                new MplsRequestHandler()
+
+        );
+
+    }
+
+    //Looking for ARP Packets
+    private final class ArpRequestHandler extends RequestHandler {
+        private ArpRequestHandler() {
+            super(ARP_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter arpCounter = counters.get("packetStatisticsComponent.arpFeature.arpPC");
+            long arpCount = arpCounter.getCount();
+            ObjectNode arpJson = objectNode();
+            arpJson.put("ArpCounter", arpCount);
+            sendMessage(ARP_RESP, arpJson);
+        }
+    }
+
+    //Looking for DHCP Packets
+    private final class DhcpRequestHandler extends RequestHandler {
+        private DhcpRequestHandler() {
+            super(DHCP_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter dhcpCounter = counters.get("packetStatisticsComponent.dhcpFeature.dhcpPC");
+            long dhcpCount = dhcpCounter.getCount();
+            ObjectNode dhcpJson = objectNode();
+            dhcpJson.put("DhcpCounter", dhcpCount);
+            log.info("Received DHCP Request");
+            sendMessage(DHCP_RESP, dhcpJson);
+        }
+    }
+    //Looking for ICMP Packets
+    private final class IcmpRequestHandler extends RequestHandler {
+        private IcmpRequestHandler() {
+            super(ICMP_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter icmpCounter = counters.get("packetStatisticsComponent.icmpFeature.icmpPC");
+            long icmpCount = icmpCounter.getCount();
+            ObjectNode icmpJson = objectNode();
+            icmpJson.put("IcmpCounter", icmpCount);
+            log.info("Received ICMP Request");
+            sendMessage(ICMP_RESP, icmpJson);
+        }
+    }
+    //Looking for LLDP Packets
+    private final class LldpRequestHandler extends RequestHandler {
+        private LldpRequestHandler() {
+            super(LLDP_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter lldpCounter = counters.get("packetStatisticsComponent.lldpFeature.lldpPC");
+            long lldpCount = lldpCounter.getCount();
+            ObjectNode lldpJson = objectNode();
+            lldpJson.put("LldpCounter", lldpCount);
+            log.info("Received LLDP Request");
+            sendMessage(LLDP_RESP, lldpJson);
+        }
+    }
+    //Looking for VLAN Packets
+    private final class VlanRequestHandler extends RequestHandler {
+        private VlanRequestHandler() {
+            super(VLAN_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter vlanCounter = counters.get("packetStatisticsComponent.vlanFeature.vlanPC");
+            long vlanCount = vlanCounter.getCount();
+            ObjectNode vlanJson = objectNode();
+            vlanJson.put("VlanCounter", vlanCount);
+            log.info("Received VLAN Request");
+            sendMessage(VLAN_RESP, vlanJson);
+        }
+    }
+    //Looking for IGMP Packets
+    private final class IgmpRequestHandler extends RequestHandler {
+        private IgmpRequestHandler() {
+            super(IGMP_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter igmpCounter =  counters.get("packetStatisticsComponent.igmpFeature.igmpPC");
+            long igmpCount = igmpCounter.getCount();
+            ObjectNode igmpJson = objectNode();
+            igmpJson.put("IgmpCounter", igmpCount);
+            log.info("Received IGMP Request");
+            sendMessage(IGMP_RESP, igmpJson);
+        }
+    }
+    //Looking for PIM Packets
+    private final class PimRequestHandler extends RequestHandler {
+        private PimRequestHandler() {
+            super(PIM_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter pimCounter =  counters.get("packetStatisticsComponent.pimFeature.pimPC");
+            long pimCount = pimCounter.getCount();
+            ObjectNode pimJson = objectNode();
+            pimJson.put("PimCounter", pimCount);
+            log.info("Received PIM Request");
+            sendMessage(PIM_RESP, pimJson);
+        }
+    }
+    //Looking for PIM Packets
+    private final class BsnRequestHandler extends RequestHandler {
+        private BsnRequestHandler() {
+            super(BSN_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter bsnCounter =  counters.get("packetStatisticsComponent.bsnFeature.bsnPC");
+            long bsnCount = bsnCounter.getCount();
+            ObjectNode bsnJson = objectNode();
+            bsnJson.put("BsnCounter", bsnCount);
+            log.info("Received BSN Request");
+            sendMessage(BSN_RESP, bsnJson);
+        }
+    }
+    //Looking for PIM Packets
+    private final class UnknownRequestHandler extends RequestHandler {
+        private UnknownRequestHandler() {
+            super(UNKNOWN_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter unknownCounter =  counters.get("packetStatisticsComponent.unknownFeature.unknownPC");
+            long unknownCount = unknownCounter.getCount();
+            ObjectNode unknownJson = objectNode();
+            unknownJson.put("UnknownCounter", unknownCount);
+            log.info("Received UNKNOWN Request");
+            sendMessage(UNKNOWN_RESP, unknownJson);
+        }
+    }
+    //Looking for PIM Packets
+    private final class MplsRequestHandler extends RequestHandler {
+        private MplsRequestHandler() {
+            super(MPLS_REQ);
+        }
+
+        @Override
+        public void process(ObjectNode payload) {
+            MetricsService service = get(MetricsService.class);
+            Map<String, Counter> counters = service.getCounters(filter);
+            Counter mplsCounter =  counters.get("packetStatisticsComponent.mplsFeature.mplsPC");
+            long mplsCount = mplsCounter.getCount();
+            ObjectNode mplsJson = objectNode();
+            mplsJson.put("MplsCounter", mplsCount);
+            log.info("Received MPLS Request");
+            sendMessage(MPLS_RESP, mplsJson);
+        }
+    }
+
+
+}
\ No newline at end of file
diff --git a/apps/packet-stats/src/main/resources/app/view/sampleCustom/sampleCustom.css b/apps/packet-stats/src/main/resources/app/view/sampleCustom/sampleCustom.css
new file mode 100644
index 0000000..84f9685
--- /dev/null
+++ b/apps/packet-stats/src/main/resources/app/view/sampleCustom/sampleCustom.css
@@ -0,0 +1,116 @@
+/* css for sample app custom view */
+
+#ov-sample-custom {
+    padding: 20px;
+}
+.light #ov-sample-custom {
+    color: navy;
+}
+.dark #ov-sample-custom {
+    color: #88f;
+}
+
+#ov-sample-custom .button-panel {
+    margin: 10px;
+    width: 200px;
+}
+
+.light #ov-sample-custom .button-panel {
+    background-color: #ccf;
+}
+.dark #ov-sample-custom .button-panel {
+    background-color: #444;
+}
+
+#ov-sample-custom .my-button {
+    cursor: pointer;
+    padding: 4px;
+    text-align: center;
+}
+
+.light #ov-sample-custom .my-button {
+    color: white;
+    background-color: #8b8386;
+}
+.dark #ov-sample-custom .my-button {
+    color: black;
+    background-color: #aaa;
+}
+
+#ov-sample-custom .number {
+    font-size: 140%;
+    text-align: right;
+}
+
+#ov-sample-custom .quote {
+    margin: 10px 20px;
+    font-style: italic;
+}
+
+.bar rect {
+  fill: steelblue;
+}
+
+.bar text {;
+  font: 15px sans-serif;
+}
+
+
+.chart div {
+  font: 10px sans-serif;
+  background-color: steelblue;
+  text-align: right;
+  padding: 3px;
+  margin: 1px;
+  color: white;
+}
+     body {
+        width: 1450px;
+        height: 500px;
+        position: relative;
+        background-color:#DFE5EA;
+    }
+
+    svg {
+        width: 100%;
+        height: 100%;
+        position: center;
+    }
+
+    .toolTip {
+        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+        position: absolute;
+        display: none;
+        width: auto;
+        height: auto;
+        background: none repeat scroll 0 0 white;
+        border: 0 none;
+        border-radius: 8px 8px 8px 8px;
+        box-shadow: -3px 3px 15px #888888;
+        color: black;
+        font: 12px sans-serif;
+        padding: 5px;
+        text-align: center;
+    }
+
+    text {
+        font: 17px sans-serif;
+    }
+    text.value {
+        font-size: 150%;
+        fill: white;
+    }
+
+    .axisHorizontal path{
+        fill: none;
+    }
+
+    .axisHorizontal .tick line {
+        stroke-width: 1;
+        stroke: rgba(0, 0, 0, 0.2);
+    }
+
+    .bar {
+        fill: steelblue;
+        fill-opacity: .9;
+    }
\ No newline at end of file
diff --git a/apps/packet-stats/src/main/resources/app/view/sampleCustom/sampleCustom.html b/apps/packet-stats/src/main/resources/app/view/sampleCustom/sampleCustom.html
new file mode 100644
index 0000000..ef8d1aa
--- /dev/null
+++ b/apps/packet-stats/src/main/resources/app/view/sampleCustom/sampleCustom.html
@@ -0,0 +1,18 @@
+<!-- partial HTML of patch panel app -->
+<meta charset="utf-8">
+<head>
+</head>
+
+<body style="background-color:powderblue;">
+
+<h2><center>Packet Statistics</center></h2>
+
+<div id="ov-sample-custom" ng-controller="OvSampleCustomCtrl">
+    <center><div class="button-panel">
+        <div class="my-button" ng-click="dthreestuff()">
+            Generate Graph
+        </div>
+    </div>
+    </center>
+
+</div>
\ No newline at end of file
diff --git a/apps/packet-stats/src/main/resources/app/view/sampleCustom/sampleCustom.js b/apps/packet-stats/src/main/resources/app/view/sampleCustom/sampleCustom.js
new file mode 100644
index 0000000..5122047
--- /dev/null
+++ b/apps/packet-stats/src/main/resources/app/view/sampleCustom/sampleCustom.js
@@ -0,0 +1,295 @@
+// js for patch panel app custom view
+/**
+IMPORTANT CHANGES THAT MUST BE MADE BEFORE SUBMITTING
+
+-Graph is not being updated with packet counters. The counters is only set to 0.
+ This is a New bug, after individual buttons were removed.
+-HTML Page is not being resized depending on the the size of the screen.
+-Must Enable Scrolling
+-Can Remove Redundant Code and create one json file, instead of multiple.
+-Add comments and work on the code formatting.
+
+Due to a paucity of time, I couldn't work on some of these important changes.
+The first bug is very important to correct and the code should not be in the ONOS
+codebase without the change.
+
+Feel free to contact me for any issues.
+**/
+var strdhcpval = "h";
+ (function () {
+     'use strict';
+     // injected refs
+     var $log, $scope, wss, d3Elem;
+
+     // constants remember to change this stuff!!s
+     var arpReq = 'arpRequest',
+         arpResp = 'arpResponse';
+     var dhcpReq = 'dhcpRequest',
+         dhcpResp = 'dhcpResponse';
+     var icmpReq = 'icmpRequest',
+         icmpResp = 'icmpResponse';
+     var lldpReq = 'lldpRequest',
+         lldpResp = 'lldpResponse';
+     var vlanReq = 'vlanRequest',
+         vlanResp = 'vlanResponse';
+     var igmpReq = 'igmpRequest',
+         igmpResp = 'igmpResponse';
+     var pimReq = 'pimRequest',
+         pimResp = 'pimResponse';
+     var bsnReq = 'bsnRequest',
+         bsnResp = 'bsnResponse';
+     var unknownReq = 'unknownRequest',
+         unknownResp = 'unknownResponse';
+     var mplsReq = 'mplsRequest',
+         mplsResp = 'mplsResponse';
+     var arpval = 0;
+     var dhcpval = 0;
+     var icmpval = 0;
+     var lldpval = 0;
+     var vlanval = 0;
+     var igmpval = 0;
+     var pimval = 0;
+     var bsnval =0;
+     var unknownval =0;
+     var mplsval = 0;
+
+     var arpMsg  = "";
+     var dhcpMsg = "";
+     var icmpMsg = "";
+     var lldpMsg = "";
+     var vlanMsg = "";
+     var igmpMsg = "";;
+     var pimMsg = "";
+     var bsnMsg = "";
+     var unknownMsg = "";
+     var mplsMsg = "";
+
+     function arpGetter() {
+        wss.sendEvent(arpReq);
+     }
+     function icmpGetter() {
+         wss.sendEvent(icmpReq);
+     }
+     function lldpGetter() {
+         wss.sendEvent(lldpReq);
+     }
+     function dhcpGetter() {
+         wss.sendEvent(dhcpReq);
+     }
+     function vlanGetter() {
+         wss.sendEvent(vlanReq);
+     }
+
+     function igmpGetter() {
+         wss.sendEvent(igmpReq);
+     }
+     function pimGetter() {
+         wss.sendEvent(pimReq);
+     }
+     function bsnGetter() {
+         wss.sendEvent(bsnReq);
+     }
+     function unknownGetter() {
+         wss.sendEvent(unknownReq);
+     }
+     function mplsGetter() {
+         wss.sendEvent(mplsReq);
+     }
+
+
+     function dthreestuff() {
+     wss.sendEvent(dhcpReq);
+     wss.sendEvent(unknownReq);
+     wss.sendEvent(mplsReq);
+    var data = [
+        {label:"ARP", value:arpval},
+        {label:"ICMP", value:icmpval},
+        {label:"DHCP", value:dhcpval},
+        {label:"PIM", value:pimval},
+        {label:"BSN", value:bsnval},
+        {label:"IGMP", value:igmpval},
+        {label:"LLDP", value:lldpval},
+        {label:"VLAN", value:vlanval},
+        {label:"MPLS", value:mplsval},
+        {label:"Unknown", value:unknownval}
+    ];
+
+
+    var div = d3.select("body").append("div").attr("class", "toolTip");
+
+    var axisMargin = 20,
+            margin = 40,
+            valueMargin = 4,
+            width = parseInt(d3.select('body').style('width'), 10),
+            height = parseInt(d3.select('body').style('height'), 10),
+            barHeight = (height-axisMargin-margin*2)* 0.4/data.length,
+            barPadding = (height-axisMargin-margin*2)*0.6/data.length,
+            data, bar, svg, scale, xAxis, labelWidth = 0;
+
+    var max = d3.max(data, function(d) { return d.value; });
+
+    var svg = d3.select('body')
+            .append("svg")
+            .attr("width", width)
+            .attr("height", height);
+
+
+    var bar = svg.selectAll("g")
+            .data(data)
+            .enter()
+            .append("g");
+
+    bar.attr("class", "bar")
+            .attr("cx",0)
+            .attr("transform", function(d, i) {
+                return "translate(" + margin + "," + (i * (barHeight + barPadding) + barPadding) + ")";
+            });
+
+    bar.append("text")
+            .attr("class", "label")
+            .attr("y", barHeight / 2)
+            .attr("dy", ".35em") //vertical align middle
+            .text(function(d){
+                return d.label;
+            }).each(function() {
+        labelWidth = Math.ceil(Math.max(labelWidth, this.getBBox().width));
+    });
+
+    var scale = d3.scale.linear()
+            .domain([0, max])
+            .range([0, width - margin*2 - labelWidth]);
+
+    var xAxis = d3.svg.axis()
+            .scale(scale)
+            .tickSize(-height + 2*margin + axisMargin)
+            .orient("bottom");
+
+    bar.append("rect")
+            .attr("transform", "translate("+labelWidth+", 0)")
+            .attr("height", barHeight)
+            .attr("width", function(d){
+                return scale(d.value);
+            });
+
+    bar.append("text")
+            .attr("class", "value")
+            .attr("y", barHeight / 2)
+            .attr("dx", -valueMargin + labelWidth) //margin right
+            .attr("dy", ".35em") //vertical align middle
+            .attr("text-anchor", "end")
+            .text(function(d){
+                return (d.value+" Packets");
+            })
+            .attr("x", function(d){
+                var width = this.getBBox().width;
+                return Math.max(width + valueMargin, scale(d.value));
+            });
+
+    bar
+            .on("mousemove", function(d){
+                div.style("left", d3.event.pageX+10+"px");
+                div.style("top", d3.event.pageY-25+"px");
+                div.style("display", "inline-block");
+                div.html((d.label)+"<br>"+(d.value)+" Packets");
+            });
+    bar
+            .on("mouseout", function(d){
+                div.style("display", "none");
+            });
+
+    svg.insert("g",":first-child")
+            .attr("class", "axisHorizontal")
+            .attr("transform", "translate(" + (margin + labelWidth) + ","+ (height - axisMargin - margin)+")")
+            .call(xAxis);
+
+     }
+
+     function responseArp(data) {
+        arpval = data.DhcpCounter;
+     }
+
+
+     function responseDhcp(data) {
+        dhcpval = data.DhcpCounter;
+     }
+
+     function responseIcmp(data) {
+        icmpval = data.IcmpCounter;
+     }
+     function responseLldp(data) {
+        lldpval = data.LldpCounter;
+     }
+     function responseVlan(data) {
+        vlanval = data.VlanCounter;
+     }
+     function responseIgmp(data) {
+        igmpval = data.IgmpCounter;
+     }
+     function responsePim(data) {
+        pimval = data.PimCounter;
+     }
+     function responseBsn(data) {
+        bsnval = data.BsnCounter;
+     }
+     function responseUnknown(data) {
+        unknownval = data.UnknownCounter;
+     }
+
+      function responseMPLS(data) {
+        mplsval = data.MplsCounter;
+      }
+
+     var app = angular.module('ovSampleCustom', [])
+         .controller('OvSampleCustomCtrl',
+         ['$log', '$scope', 'WebSocketService',
+
+         function (_$log_, _$scope_, _wss_, ) {
+             $log = _$log_;
+             $scope = _$scope_;
+             wss = _wss_;
+
+
+             var handlers = {};
+             $scope.data = {};
+
+             // data response handler
+             handlers[arpResp] = responseArp;
+             handlers[dhcpResp] = responseDhcp;
+             handlers[icmpResp] = responseIcmp;
+             handlers[lldpResp] = responseLldp;
+             handlers[vlanResp] = responseVlan;
+             handlers[igmpResp] = responseIgmp;
+             handlers[pimResp] = responsePim;
+             handlers[bsnResp] = responseBsn;
+             handlers[unknownResp] = responseUnknown;
+             handlers[mplsResp] = responseMPLS;
+             wss.bindHandlers(handlers);
+
+
+             // custom click handler
+             $scope.arpGetter = arpGetter;
+             $scope.icmpGetter = icmpGetter;
+             $scope.dhcpGetter = dhcpGetter;
+             $scope.lldpGetter = lldpGetter;
+             $scope.vlanGetter = vlanGetter;
+             $scope.igmpGetter = igmpGetter;
+             $scope.pimGetter = pimGetter;
+             $scope.bsnGetter = bsnGetter;
+             $scope.unknownGetter = unknownGetter;
+             $scope.mplsGetter = mplsGetter;
+             $scope.dthreestuff = dthreestuff;
+
+
+
+             // cleanup
+             $scope.$on('$destroy', function () {
+                 wss.unbindHandlers(handlers);
+                 $log.log('OvSampleCustomCtrl has been destroyed');
+             });
+
+             $log.log('OvSampleCustomCtrl has been created');
+         }]);
+
+
+
+ }());
\ No newline at end of file
diff --git a/apps/packet-stats/src/main/resources/sampleCustom/css.html b/apps/packet-stats/src/main/resources/sampleCustom/css.html
new file mode 100644
index 0000000..4e7b709
--- /dev/null
+++ b/apps/packet-stats/src/main/resources/sampleCustom/css.html
@@ -0,0 +1 @@
+<link rel="stylesheet" href="app/view/sampleCustom/sampleCustom.css">
\ No newline at end of file
diff --git a/apps/packet-stats/src/main/resources/sampleCustom/js.html b/apps/packet-stats/src/main/resources/sampleCustom/js.html
new file mode 100644
index 0000000..6550b85
--- /dev/null
+++ b/apps/packet-stats/src/main/resources/sampleCustom/js.html
@@ -0,0 +1 @@
+<script src="app/view/sampleCustom/sampleCustom.js"></script>
\ No newline at end of file
