added initial value to Reg
update counter so it compiles with g++