initial stuff mostly generated and copied from other plugins