Added an x register that is needed to latch input