added sapply that guarantees sequential application of a function to
tuple elements