set local for local variable
version 5, the finished version!