added register management subroutines