Implemented shared preferences

#508