Set Slave was written by John Amuedo (JohnAmuedo@aol.com) as a masters thesis, if I remember correctly. He has function(s) that do this. If you can't get in touch with him let me know and ill write it for you.