locate: add some logging and comments