tweak func
complete comments
now working on local variable