Adding fields to functions