Implemented Max's suggestions