retrieve function. I am not sure if it works