finally got this damned thing working