save new patterns
update functionality
merged
fixed indentation