pseudo code for updating posts