The length of a rectangle is 2 inches less than 3 times the number of inches in its width. If the perimeter of the rectangle is 28 inches, what is the width and length of the rectangle?