change type of toOutput to pass into toRTree