Made necessary variables private. Added docs.