This should be a valid solution unless I made a mistake somewhere. Marking this as a showcase for now until I figure out how to actually validate and submit it.