Fixing style by making fields private

The fields were made from public to private and accessor methods for
each field was implemented.