added Pattern class