Added functions to get and set registers