added method to count the number of used sectors