Found out that the code already existed, removing unnecessary code
Inserting nms + smaller changes