develop the result code for each function