refactored _atoms data structure to defaultdict for fast access to individual atom types