Adding name argument to assignField method
Adding assignField logic