pseudocode for messages SharedPref