First version of Plugin

First working version, needs a lot of refactoring to make it efficient.
However need to keep this safe so we can revert back if refactoring
does not work out.