Fixed some issues. Will need a bit more work to make this tryphon code work.