Modify output block to get values in correct order