finally got this working!