i described this challenge, in details, at an old blog that has been closed down. here is an overview of the related posts.