Implemented getting messages in an ordered fashion