added addFields function