Actually works now, some debug still left in