query method implemented