Changed the way the final string is returned to make it easier to extend