moving appending feed into a function.