added levels to patterns