Fixed the formatSubjectString function

All the comments are in the code