Added JavaDoc comments to methods and constructor.
Changed variablesm from private to protected.