Implement query method