implemented the where method