Clean-up and formatting, plus new asm routines