Improved code documenation and added message retrieval and display