make loc smarter