Changes made according to Mark's comments