Added some more code to start reading the pattern data.