Added some comments to javascript and ensured entry box is cleared ready for next message