Made attributes private and documented the code.