program to delete unused itunes songs


i have alot of songs in my itunes library. but alot of them are ones that i downloaded and didn't want. is there a program out there to delete songs that aren't in any of my folders and just in the library? or would it be hard to write a script for that?