#9 improved by checking second rect's vertices too