Replaced the String variable with a StringBuilder in the convert method