added local functions