Added function to load patterns. Tested.