Generating the output appropriately