add toplevelsize counting