Restructured the plugin, added comments.