Borrowing some code from WP Tag This plugin by antonioandra.de