buggy count functions