added Pattern class to hold stored patterns