I fooled around with this and ended up changing the method to something simpler -- take a look and let me know what you think.