A rectangle with sides 7 and #x+2# has a perimeter of 40 units. What is the value of #x#?