Writing your own plugins