correct use of registers parameter instead of global variable Registers