changing string builder to add js function, line by line