added locks, grouped accessors and mutators together