local storage

Added functions for local storage.