compile of changes and more bug fixes

move around a few lines and changed a loop variable.  then I
re-compiled the code.