Fixed as per Mack's suggestions