Added all counting functionality