added a public get data function