Remove first length check from function, implement more elegant way to build the string.