redo of the whole generate Posts controller