change the struct and add detail functoin