Updated for Odyssey changes to ganglinks, fixed a couple calculation bugs, did a bit of tidying up, and added publically available debug option