Cleaning up code.  Created a bug in the retrieveConversations function