Major rewrite!  Too many changes to comment!