Finally, I think I have this working!