construct data structure for opt