implmented code to fetch outputs referenced by inputs to trxs