Changed some method names and added java doc.