Updated for writing correct number of characters.