implemented the plugin allocate method.