building up for the last part of the result function in modifyajax