Writing algebraic expressions for the perimeter of a figure