Replaced some code with matchMargins, renamed some variables.