Added a few comments and completed JavaDocs for all methods