merged david's news feed code