WARNING ugly code, doc updated