change restore method to return T
modify comments