initial work done for retrieving and saving