implemented regionfactory and surfacefactory and restored tallyfactory
merged changees in tally class