Changed all functions into methods and wrote the accessors needed (attributes are private)