the plot thickens. .. Some time later... I spent way too long on this