OBSOLETE code from unit_JS in chrono, placed here to preserve history