Layer class and the match method