Implement: Layer class and the match method.