adds locals to variables