Structure changes. Added javaDoc.