updated to work with new outputs