implemented structure of restore functionality