added all code for custom fields outputs
fixed merge conflicts