added a crapload of crap that may or may norbe neccassary. Time will tell. Also, got footnote references working.