Added function to check if the field already exists.
Finished Patterns create and modify function.