implemented some methods in locator.js from C#, untested