Cleaned out legacy code, reduced to mission-required functions + debug