wrote working n-posts function