Code at the end of Troy.

The final version of code after Troy. Needs clean up