simplified plugin

simplified the plugin and changed some parts to be more WordPress
compliant