Tried writing elem in the counting monad.