updated code comments and included java doc