Wrote plugin loading code