Fixed match: based on lecture 4.