correct function levels
parent locals are access corectly from calling functions