patterns implementation
fixes for patterns