Move display output first; fix terrible memory-clobber bug

C is hard, let's go shopping