Rewrote visitor to return a specified number of levels