rewrote stack and register file to improve timing