implemented patterns in modules