moved register assignment into constructor