Finally got this thing working