codes used for generating the results