some alterations to the molecule class and its constructor