implemented exec()