add two codesamples to localty principle