added register calculator, attr. to Ben Garside