Added remote and query functionality