main stripped by ifdefs & preserved for debugging