Updated FPGA code