remove double where options
add a counter function