dotimes and changed to allow cascaded operations