added functionality to read registers