Working now, with a few bugs