Added getters and setters. Cleaned up code