YTEX stuff being used correctly now (in the right place) but not as comprehensively. Contains some info statements for debugging.