dont need most of this code now, moved to the plugin