Updated for new basecode

Not quite finished but it's working.