cleanup'
some count functions added