Completely reworked plugin. Added metrics, simplified a few things. Hopefully it works.