added retrieve function