construct main structure